<template>
  <van-row class="card">
    <van-col :span="4" style="padding: 0.3125rem">
      <img :src="data.cardImg" alt="">
    </van-col>
    <van-col :span="20" class="rightContent">
      <van-row>
        <van-col :span="10" class="cardTitle">
          <span class="title">
            {{data.cardTitle}}
          </span>
          <span v-if="data.cardHot" class="dotNum"></span>
        </van-col>
        <van-col :span="14" class="cardTime" v-if="data.timeLimit">
          <span>{{data.timeLimit || ''}}</span>
        </van-col>
      </van-row>
      <van-row>
        <van-col :span="22">
          <p>{{data.cardDesc}}</p>
        </van-col>
        <van-col :span="2" style="margin-top: 0.3125rem;" v-if="data.cardNum">
          <div class="hot">
            <span>{{data.cardNum}}</span>
          </div>
        </van-col>
      </van-row>
    </van-col>
  </van-row>
</template>

<script>
  export default {
    props: ['cardType', 'data', 'isBtn'],
    data() {
      return {
      }
    }
  }
</script>

<style scoped lang="scss">
  .card{
    padding: 0.625rem;
    font-size: 0.875rem;
    border-top: 0.0625rem solid #ececec;
    .rightContent{
      padding: 0.3125rem;
      .cardTitle{
        font-size: 1rem;
        font-weight: bold;
        position: relative;
        .title{
          padding-right: 0.3125rem;
        }
        .dotNum{
          font-size: 0.75rem;
          position: absolute;
          top: 0.3125rem;
          width: 0.375rem;
          height: 0.375rem;
          text-align: center;
          line-height: 1.25rem;
          color: #fff;
          background-color: #f00;
          border-radius: 50%;
        }
        .num{
          font-size: 0.75rem;
          position: absolute;
          top: -0.3125rem;
          right: -1.25rem;
          width: 1.25rem;
          height: 1.25rem;
          text-align: center;
          line-height: 1.25rem;
          color: #fff;
          background-color: #f00;
          border-radius: 50%;
        }
      }
      .cardTime{
        text-align: right;
      }
      .btn{
        text-align: right;
      }
      p{
        color: #999;
        margin: 0.3125rem 0;
        overflow: hidden;
        text-overflow:ellipsis;
        white-space: nowrap;
      }
    }
    .hot{
      text-align: center;
      font-size: 0.75rem;
      color: #fff;
      background-color: #FF0000;
      line-height: 0.9375rem;
      width: 0.9375rem;
      height: 0.9375rem;
      border-radius: 50%;
    }
    img{
      width: 100%;
    }
  }
</style>
